<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const user = {
        username: 'jack',
        age: 20,
        gender: 'boy',
        size: { h: 200, w: 100 },
        a: { x: 1, y: 2 },
      };
      console.log(
        JSON.stringify(
          user,
          function (k, v) {
            /*
              1. 执行次数 递归次数
              2. k 属性 v 值
              3. return undefind 排除 return 其他 替换
            */
            if (k === 'age') {
              return v + '岁';
              // return undefined;
            }
            if (typeof v === 'number') {
              return v * 100;
            }
            return v;
          },
          4
        )
      );
    </script>
  </body>
</html>
